<template>
  <n-config-provider :locale="locale" :date-locale="dlocale">
    <el-config-provider :locale="locales">
      <HomeView v-if="path != '/login'"></HomeView>
      <Login v-else></Login>
    </el-config-provider>
  </n-config-provider>
</template>
<script setup lang="ts">
import HomeView from "./views/Home/HomeView.vue";
import Login from "./views/Login/Login.vue";
import { ref, watch } from "vue";
import { useRoute } from "vue-router";
import { zhCN, dateZhCN } from 'naive-ui';
import { ElConfigProvider } from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
const locales = ref(zhCn)
const locale = ref(zhCN)
const dlocale = ref(dateZhCN)
const route = useRoute();
let path = ref<string>();
watch(
  () => route.path,
  (newValue, oldValue) => {
    path.value = newValue;
  },
  { immediate: true }
);
</script>
<style lang="scss">
* {
  margin: 0;
  padding: 0;
}
</style>
